package com.beyond.trace.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.NotEmpty;

/**
 * 批次信息对象 t_trace_batch
 * 
 * @author yao
 * @date 2022-03-02
 */
@Data
@TableName("t_trace_batch")
public class TraceBatch extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(value = "batch_id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long batchId;

    /** 批次编号 */
    @Excel(name = "批次编号")
    @ApiModelProperty(value = "批次编号")
    private String batchNo;

    /** 产品 */
    @Excel(name = "产品")
    @ApiModelProperty(value = "产品")
    @NotEmpty(message = "产品不能为空")
    private String batchProduct;

    /** 种植日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "种植日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "种植日期")
    private Date batchPlantTime;

    /** 收获日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "收获日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "收获日期")
    private Date batchHarvestTime;

    /** 负责人 */
    @Excel(name = "负责人")
    @ApiModelProperty(value = "负责人")
    private String batchPerson;

    /** 负责人联系方式 */
    @Excel(name = "负责人联系方式")
    @ApiModelProperty(value = "负责人联系方式")
    private String batchPersonPhone;

    /** 产品名称 */
    @TableField(exist = false)
    private String productName;

    @Excel(name = "部门id")
    @ApiModelProperty(value = "部门id")
    @JsonIgnore
    private String departId;

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }



    public void setBatchId(Long batchId) 
    {
        this.batchId = batchId;
    }

    public Long getBatchId() 
    {
        return batchId;
    }
    public void setBatchNo(String batchNo) 
    {
        this.batchNo = batchNo;
    }

    public String getBatchNo() 
    {
        return batchNo;
    }
    public void setBatchProduct(String batchProduct) 
    {
        this.batchProduct = batchProduct;
    }

    public String getBatchProduct() 
    {
        return batchProduct;
    }
    public void setBatchPlantTime(Date batchPlantTime) 
    {
        this.batchPlantTime = batchPlantTime;
    }

    public Date getBatchPlantTime() 
    {
        return batchPlantTime;
    }
    public void setBatchHarvestTime(Date batchHarvestTime) 
    {
        this.batchHarvestTime = batchHarvestTime;
    }

    public Date getBatchHarvestTime() 
    {
        return batchHarvestTime;
    }
    public void setBatchPerson(String batchPerson) 
    {
        this.batchPerson = batchPerson;
    }

    public String getBatchPerson() 
    {
        return batchPerson;
    }
    public void setBatchPersonPhone(String batchPersonPhone) 
    {
        this.batchPersonPhone = batchPersonPhone;
    }

    public String getBatchPersonPhone() 
    {
        return batchPersonPhone;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("batchId", getBatchId())
            .append("batchNo", getBatchNo())
            .append("batchProduct", getBatchProduct())
            .append("batchPlantTime", getBatchPlantTime())
            .append("batchHarvestTime", getBatchHarvestTime())
            .append("batchPerson", getBatchPerson())
            .append("batchPersonPhone", getBatchPersonPhone())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
}
